component.inputmask

inputmask

d/m/y mask
Changing placeholder
Multi-char placeholder
€ 999.999.999,99
(999) 999-9999
Multi-char placeholder
Allow numbers & decimals
999-99-9999
<div class="row">
	<div class="col-md-6">
		<label class="strong">Date #1</label>
		<input type="text" id="inputmask-date" class="form-control span8" placeholder="__/__/____" />
		<span class="help-inline">d/m/y mask</span>
		<div class="separator bottom"></div>
		
		<label class="strong">Date #2</label>
		<input type="text" id="inputmask-date-1" class="form-control span8" placeholder="**/**/****" />
		<span class="help-inline">Changing placeholder</span>
		<div class="separator bottom"></div>
		
		<label class="strong">Date #3</label>
		<input type="text" id="inputmask-date-2" class="form-control span8" placeholder="dd/mm/yyyy" />
		<span class="help-inline">Multi-char placeholder</span>
		<div class="separator bottom"></div>
		
		<label class="strong">Currency</label>
		<input type="text" id="inputmask-currency" class="form-control span8" placeholder="&euro; 999.999.999,99" />
		<span class="help-inline">&euro; 999.999.999,99</span>
	</div>
	<div class="col-md-6">
		<label class="strong">Phone Number</label>
		<input type="text" id="inputmask-phone" class="form-control span8" placeholder="(123) 456-7890" />
		<span class="help-inline">(999) 999-9999</span>
		<div class="separator bottom"></div>
		
		<label class="strong">VAT Number</label>
		<input type="text" id="inputmask-tax" class="form-control span8" placeholder="12-3456789" />
		<span class="help-inline">Multi-char placeholder</span>
		<div class="separator bottom"></div>
		
		<label class="strong">Decimal</label>
		<input type="text" id="inputmask-decimal" class="form-control span8" placeholder="123.01" />
		<span class="help-inline">Allow numbers &amp; decimals</span>
		<div class="separator bottom"></div>
		
		<label class="strong">SSN</label>
		<input type="text" id="inputmask-ssn" class="form-control span8" placeholder="999-99-9999" />
		<span class="help-inline">999-99-9999</span>
	</div>
</div>

Code

@import "assets/components/core/less/forms.less";

Usage

  1. Create a new LESS file (eg. styles.less)
  2. Copy & paste the above imports in the LESS file.
  3. Place the file in your project's document root.
  4. Load the LESS file into the <head> section of your HTML document, before any JavaScript files:

    <link type="stylesheet/less" href="styles.less" />

    NOTE  All the styles from the CORE package also need to be imported in this file, before the component imports.

  5. If you'd like to include other components on the same page, don't create multiple LESS files, but add all the imports in one file. You can create a LESS file for each page with just the resources used for that specific page, or you could create and use a single LESS file for the entire project.
  6. In production, compile the LESS file and use the resulting minified CSS file in the HTML document.

Scripts

BODY You should include the following scripts at the end of the HTML document, right before the closing </body> tag.

<script src="assets/components/modules/admin/forms/elements/inputmask/assets/lib/jquery.inputmask.bundle.min.js?v=v1.2.3"></script>
<script src="assets/components/modules/admin/forms/elements/inputmask/assets/custom/inputmask.init.js?v=v1.2.3"></script>